<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>autoload? (Autoload)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre>    <span class="ruby-comment cmt"># File lib/autoload.rb, line 38</span>
38:                         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">autoload?</span>( <span class="ruby-identifier">cname</span> )
39: 
40:                                 <span class="ruby-identifier">cname</span> = <span class="ruby-identifier">cname</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([a-z\d])([A-Z])/</span>){ <span class="ruby-node">&quot;#{$1}_#{$2.downcase}&quot;</span>}
41:                                 
42:                                 <span class="ruby-comment cmt"># is this name autoloadable?</span>
43:                                 <span class="ruby-identifier">key</span> = ( <span class="ruby-ivar">@autoload</span> <span class="ruby-operator">||=</span> [] ).<span class="ruby-identifier">find</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> 
44:                                         <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">||</span> ( <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">cname</span> )
45:                                 <span class="ruby-keyword kw">end</span>
46:                                 
47:                         <span class="ruby-keyword kw">end</span></pre>
</body>
</html>